<template>
  <el-table
    :data="props.form.steps"
    border
    style="width: 100%"
    @row-dblclick="handleUpdateStep"
  >
    <el-table-column prop="id" label="编号" width="60" />
    <el-table-column
      label="步骤"
      align="center"
      prop="step"
      :show-overflow-tooltip="true"
    />
    <el-table-column
      label="预期"
      align="center"
      prop="exp"
      :show-overflow-tooltip="true"
    />
  </el-table>

  <!-- 步骤编辑对话框 -->
  <step-info :step="step" v-model="open" :title="title" @close="open = false">
  </step-info>
</template>

<script setup name="StepsInfo">
import StepInfo from "./StepInfo";

const open = ref(false);
const title = ref("");
const step = ref({});

const props = defineProps({
  form: {},
});

/** 步骤详细对话框事件 */
function handleUpdateStep(row) {
  if (props.form.type === "2") {
    step.value = row;
    open.value = true;
    title.value = "步骤：" + row.step;
  }
}
</script>
